package cn.tonyandmoney.voicenotes.utils

import java.text.SimpleDateFormat
import java.util.*

object DateUtils {

    const val YYYYMMDDHHmmss = "yyyyMMddHHmmss"

    fun toYYYYMMDDHHmmss(): String {
        val formatter = SimpleDateFormat("yyyyMMdd_HHmmss", Locale.CANADA)
        return formatter.format(Date())
    }


    fun toDDHHMM():String{
        val formatter = SimpleDateFormat("ddHHmm", Locale.CANADA)
        return formatter.format(Date())
    }

    fun formatter(date: Long, pattern: String): String {
        return SimpleDateFormat(pattern, Locale.CANADA).format(Date(date))
    }

    fun formatter(date: Date, pattern: String): String {
        return SimpleDateFormat(pattern, Locale.CANADA).format(date)
    }

}